<template>

  <div class="reportFormPage">
    <div class="report-dom horizontal">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">水泥净浆强度试验检测报告</div>
        <div class="codeText">BGLQ07006F</div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>报告编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.baogbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.baogbh" @focus="handleFocus('baogbh')" />
        </div>
      </div>
      <div class="table-border">
        <!------------------------------表头-------------------------->
        <table height="160px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">施工/委托单位</span>
              </td>
              <td width="35%" bgcolor="#ffffff">
                <span>{{ form.shigwtdw }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td bgcolor="#ffffff" width="35%">
                <span>{{ form.gongcmc }}</span>
              </td>
            </tr>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td colspan="3">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="50" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ 'placeholder':!form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long':!form.yangpbh }">{{ form.yangpbh }}</span>
                <span>；样品数量：</span>
                <span :class="{ 'placeholder':!form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ 'placeholder':!form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ 'placeholder':!form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>
            <tr>
              <td height="40" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="30" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!------------------------------表中-------------------------->
        <table height="300px" class="middle-table">
          <tbody>
            <tr>
              <td height="25">设计强度(MPa)</td>
              <td colspan="3"><el-input type="text" disabled v-model="form.shejqd" /></td>
              <td>试件尺寸(mm)</td>
              <td colspan="4"><el-input type="text" disabled v-model="form.shijcc" /></td>
              <td colspan="2">流动度(S)</td>
              <td colspan="2"><el-input type="text" disabled v-model="form.liudd" /></td>
            </tr>
            <tr height="25">
              <td rowspan="3">取样部位</td>
              <td rowspan="3">制件日期</td>
              <td rowspan="3">试验日期</td>
              <td rowspan="3">
                龄期
                <br />(天)
              </td>
              <td colspan="4">抗折强度</td>
              <td colspan="5">抗压强度</td>
            </tr>
            <tr height="25">
              <td rowspan="2">技术指标</td>
              <td colspan="2">检测结果</td>
              <td rowspan="2">结果判定</td>
              <td rowspan="2">技术指标</td>
              <td colspan="3">检测结果</td>
              <td rowspan="2">结果判定</td>
            </tr>
            <tr>
              <td height="25">单值</td>
              <td>平均值</td>
              <td colspan="2">单值</td>
              <td>平均值</td>
            </tr>
            <tr>
              <td height="25" width="10%" rowspan="3"><el-input type="text" disabled v-model="form.qvybw1" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.zijrq1" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.shiyrq1" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.qil1" /></td>
              <td width="10%" rowspan="3">
                <!-- <el-input type="text" disabled v-model="form.kangzqdjszb1" /> -->

                <el-input type="text" v-model="form.kangzqdjszb1" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil1, 'kz', 1)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangzqddz11" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdpjz1" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdjgpd1" /></td>
              <td width="10%" rowspan="3">

                <el-input type="text" v-model="form.kangyqdjszb1" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil1, 'ky', 1)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz11" /></td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz12" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdpjz1" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdjgpd1" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz12" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz13" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz14" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz13" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz15" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz16" /></td>
            </tr>
            <tr>
              <td height="25" width="10%" rowspan="3"><el-input type="text" disabled v-model="form.qvybw2" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.zijrq2" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.shiyrq2" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.qil2" /></td>
              <td width="10%" rowspan="3">
                <!-- <el-input type="text" disabled v-model="form.kangzqdjszb2" /> -->
                <el-input type="text" v-model="form.kangzqdjszb2" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil2, 'kz', 2)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangzqddz21" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdpjz2" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdjgpd2" /></td>
              <td width="10%" rowspan="3">
                <!-- <el-input type="text" disabled v-model="form.kangyqdjszb2" /> -->
                <el-input type="text" v-model="form.kangyqdjszb2" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil2, 'ky', 2)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz21" /></td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz22" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdpjz2" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdjgpd2" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz22" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz23" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz24" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz23" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz25" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz26" /></td>
            </tr>
            <tr>
              <td height="25" width="10%" rowspan="3"><el-input type="text" disabled v-model="form.qvybw3" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.zijrq3" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.shiyrq3" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.qil3" /></td>
              <td width="10%" rowspan="3">
                <!-- <el-input type="text" disabled v-model="form.kangzqdjszb3" /> -->
                <el-input type="text" v-model="form.kangzqdjszb3" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil3, 'kz', 3)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangzqddz31" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdpjz3" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangzqdjgpd3" /></td>
              <td width="10%" rowspan="3">
                <!-- <el-input type="text" disabled v-model="form.kangyqdjszb3" /> -->
                <el-input type="text" v-model="form.kangyqdjszb3" class="mark" @dblclick.native="showBsJudgeBaseEditView(form.qil3, 'ky', 3)" readonly />
              </td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz31" /></td>
              <td width="5%"><el-input type="text" disabled v-model="form.kangyqddz32" /></td>
              <td width="5%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdpjz3" /></td>
              <td width="10%" rowspan="3"><el-input type="text" disabled v-model="form.kangyqdjgpd3" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz32" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz33" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz34" /></td>
            </tr>
            <tr>
              <td height="25"><el-input type="text" disabled v-model="form.kangzqddz33" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz35" /></td>
              <td><el-input type="text" disabled v-model="form.kangyqddz36" /></td>
            </tr>
            <tr>
              <td colspan="13" height="30px">
                <span v-if="isPdf" class="textarea-span">{{ form.jiancjl }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.jiancjl" @focus="handleFocus('jiancjl')" @dblclick.native="getJcjl()" />
              </td>
            </tr>
          </tbody>
        </table>
        <!------------------------------附加声明-------------------------->
        <table height="30px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!------------------------------表底-------------------------->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">审核：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">批准：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
    <bs-judge-base-edit-view ref="bsJudgeBaseEditViewRef" @submit="selectJudgeBaseEdit" :syType="syType"></bs-judge-base-edit-view>
  </div>
</template>

<script>
import { listSnjjqdsybgBsInfo, getSnjjqdsybgBsInfo, delSnjjqdsybgBsInfo, addSnjjqdsybgBsInfo, updateSnjjqdsybgBsInfo,queryJcjl } from "@/api/report_yj/snjjqdsybgBsInfo";
import BsInstrumentView from '@/views/dept/bsInstrument/BsInstrumentView.vue';
import decimal from "@/utils/big-decimal";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView";
import { emptyConvert, handleFocus, uniqueStr } from "@/views/reportForms/utils";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";
import Bus from "@/utils/bus";
import { formatDateYD } from "@/utils/index.js";
import BsJudgeBaseEditView from "@/views/sycs/bsJudgeBase/BsJudgeBaseEditView.vue";
import { computeBiQualification } from "@/api/sycs/biQualification";

export default {
  name: "snjjqdsybg",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView,
    BsJudgeBaseEditView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      numVal: null,
      baDetailVos: {},
      selectedObj: {},
      params: {},
      query: {},
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        excelId: [{ required: true, message: "主键不能为空", trigger: "blur" }]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created() {
    this.getInfo();
  },
  mounted() {
    Bus.$on("setYjqdForm", (data) => {
      console.log(data);
      
      const tableRowList = data.snjjqdjlbBsDetailList;
      this.form.shejqd = data.shejqd;
      this.form.shijcc = data.shijcc;
      this.form.liudd = data.liudd;
      this.form.fujsm = data.fujsm;

      // 主表第一行
      this.form.qvybw1 = tableRowList[0].qvybw; //'取样部位';
      this.form.qvybw2 = tableRowList[3].qvybw;
      this.form.qvybw3 = tableRowList[6].qvybw;
      this.form.zijrq1 = this.formatDateYD(tableRowList[0].zijrq); //'制件日期';
      this.form.zijrq2 = this.formatDateYD(tableRowList[3].zijrq); //'制件日期';
      this.form.zijrq3 = this.formatDateYD(tableRowList[6].zijrq); //'制件日期';
      this.form.shiyrq1 = tableRowList[0].shiyrq; //"试验日期";
      this.form.shiyrq2 = tableRowList[3].shiyrq; //"试验日期";
      this.form.shiyrq3 = tableRowList[6].shiyrq; //"试验日期";
      this.form.qil1 = tableRowList[0].qil; //"龄期";
      this.form.qil2 = tableRowList[3].qil; //"龄期";
      this.form.qil3 = tableRowList[6].qil; //"龄期";
      this.form.kangzqddz11 = tableRowList[0].kangzqddz;
      this.form.kangzqddz12 = tableRowList[1].kangzqddz;
      this.form.kangzqddz13 = tableRowList[2].kangzqddz;
      this.form.kangzqddz21 = tableRowList[3].kangzqddz;
      this.form.kangzqddz22 = tableRowList[4].kangzqddz;
      this.form.kangzqddz23 = tableRowList[5].kangzqddz;
      this.form.kangzqddz31 = tableRowList[6].kangzqddz;
      this.form.kangzqddz32 = tableRowList[7].kangzqddz;
      this.form.kangzqddz33 = tableRowList[8].kangzqddz;
      this.form.kangzqdpjz1 = tableRowList[0].kangzqdjz;
      this.form.kangzqdpjz2 = tableRowList[3].kangzqdjz;
      this.form.kangzqdpjz3 = tableRowList[6].kangzqdjz;
      this.form.kangyqddz11 = tableRowList[0].kangzqddz;
      this.form.kangyqddz12 = tableRowList[0].kangzqddz;
      this.form.kangyqddz13 = tableRowList[1].kangyqddz1;
      this.form.kangyqddz14 = tableRowList[1].kangyqddz2;
      this.form.kangyqddz15 = tableRowList[2].kangyqddz1;
      this.form.kangyqddz16 = tableRowList[2].kangyqddz2;
      this.form.kangyqddz21 = tableRowList[3].kangyqddz1;
      this.form.kangyqddz22 = tableRowList[3].kangyqddz2;
      this.form.kangyqddz23 = tableRowList[4].kangyqddz1;
      this.form.kangyqddz24 = tableRowList[4].kangyqddz2;
      this.form.kangyqddz25 = tableRowList[5].kangyqddz1;
      this.form.kangyqddz26 = tableRowList[5].kangyqddz2;
      this.form.kangyqddz31 = tableRowList[6].kangyqddz1;
      this.form.kangyqddz32 = tableRowList[6].kangyqddz2;
      this.form.kangyqddz33 = tableRowList[7].kangyqddz1;
      this.form.kangyqddz34 = tableRowList[7].kangyqddz2;
      this.form.kangyqddz35 = tableRowList[8].kangyqddz1;
      this.form.kangyqddz36 = tableRowList[8].kangyqddz2;
      this.form.kangyqdpjz1 = tableRowList[0].kangyqdjz;
      this.form.kangyqdpjz2 = tableRowList[3].kangyqdjz;
      this.form.kangyqdpjz3 = tableRowList[6].kangyqdjz;

      // this.form.qvybw1 = '抗压强度';
      // data.snjjqdjlbBsDetailList
    });
    // 检测依据
    Bus.$on("setSnjjqdsyBgJiancyj", (data) => {
      const { jiancyj, jiancyjIds } = data;
      const str = jiancyj + (this.form.jiancyj ? "、" + this.form.jiancyj : "");
      const ids = jiancyjIds + (this.form.jiancyjIds ? "," + this.form.jiancyjIds : "");
      this.form.jiancyj = uniqueStr(str, "、");
      this.form.jiancyjIds = uniqueStr(ids, ",");
    });
    // 主要设备
    Bus.$on("setSnjjqdsyBgZhuyyqsbmcjbh", (data) => {
      const { zhuyyqsbmcjbh, shebIds } = data;
      const str = zhuyyqsbmcjbh + (this.form.zhuyyqsbmcjbh ? "、" + this.form.zhuyyqsbmcjbh : "");
      const ids = shebIds + (this.form.shebIds ? "," + this.form.shebIds : "");
      this.form.zhuyyqsbmcjbh = uniqueStr(str, "、");
      this.form.shebIds = uniqueStr(ids, ",");
    });
  },
  beforeDestroy() {
    // 或者你可以使用其他合适的生命周期钩子
    // 停止监听事件
    Bus.$off("setSnjjqdsyBgJiancyj");
    Bus.$off("setSnjjqdsyBgZhuyyqsbmcjbh");
  },
  methods: {
    formatDateYD,
    // 获取详情
    getInfo() {
      getSnjjqdsybgBsInfo(this.excelId || this.$defaultExcelId).then(response => {
        this.form = response.data;
        this.baDetailVos = response.data.baDetailVos;
        if (!this.form.jiancjl) {
          this.form.jiancjl = "检测结论：";
        }
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示单个技术编辑
    showBsJudgeBaseEditView(val, type, numVal) {
      this.numVal = numVal;
      const baDetailVosData = this.baDetailVos;
      const kzObj = {
        3: 168,
        7: 169,
        28: 170
      };
      const kYObj = {
        3: 171,
        7: 172,
        28: 173
      };
      if (type == "kz") {
        //抗折强度
        let num = kzObj[val];
        let obj = baDetailVosData[num];
        obj.refQualId = obj.qualId;
        this.selectedObj = obj;
        this.$refs.bsJudgeBaseEditViewRef.init(obj);
      } else {
        //抗压强度
        let num = kYObj[val];
        let obj = baDetailVosData[num];
        obj.refQualId = obj.qualId;
        this.selectedObj = obj;
        this.$refs.bsJudgeBaseEditViewRef.init(obj);
      }
    },

    // 编辑单个技术指标后赋值
    selectJudgeBaseEdit(info) {
      if (info.qualId) {
        info.numVal = this.numVal;
        this.selectedObj = info;
      }
      this.computeDetectionResult(info);
    },

    // 计算检测结果
    computeDetectionResult(info) {
      if (!info) {
        return;
      }
      let typeObj = {
        168: "kangzqdpjz" + info.numVal,
        169: "kangzqdpjz" + info.numVal,
        170: "kangzqdpjz" + info.numVal,
        171: "kangyqdpjz" + info.numVal,
        172: "kangyqdpjz" + info.numVal,
        173: "kangyqdpjz" + info.numVal
      };
      console.log(this.form[typeObj[info.qualId]]);
      const data = {
        ...info,
        jiancjg: this.form[typeObj[info.qualId]]
      };

      computeBiQualification([data]).then((res) => {
        let keyObj = {
          168: "kangzqdjgpd" + info.numVal,
          169: "kangzqdjgpd" + info.numVal,
          170: "kangzqdjgpd" + info.numVal,
          171: "kangyqdjgpd" + info.numVal,
          172: "kangyqdjgpd" + info.numVal,
          173: "kangyqdjgpd" + info.numVal
        };
        let jszbObj = {
          168: "kangzqdjszb" + info.numVal,
          169: "kangzqdjszb" + info.numVal,
          170: "kangzqdjszb" + info.numVal,
          171: "kangyqdjszb" + info.numVal,
          172: "kangyqdjszb" + info.numVal,
          173: "kangyqdjszb" + info.numVal
        };

        const returnData = res.data;
        returnData.forEach((item) => {
          item.jiancjg = item.jiancjg ? item.jiancjg : "-";
          this.form[keyObj[item.qualId]] = item.jiegpd;
          this.form[jszbObj[item.qualId]] = item.jiszb;
          // this.form.baDetailVos[item.qualId] = item;
        });
      });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
    },


    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },

    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
    },
    // 获取检测结论
    getJcjl() {
      const form = JSON.parse(JSON.stringify(this.form));
      queryJcjl(emptyConvert(form)).then((res) => {
        const info = res.data;
        this.form.jiancjl = info.jiancjl;
      });
    },

    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    }
  }
};
</script>


<style scoped>

</style>
